package com.jspgou.cms.entity;

import org.apache.commons.lang.StringUtils;

import com.jspgou.cms.entity.base.BaseStoreTxt;



public class StoreTxt extends BaseStoreTxt {
	private static final long serialVersionUID = 1L;

/*[CONSTRUCTOR MARKER BEGIN]*/
	public StoreTxt () {
		super();
	}

	/**
	 * Constructor for primary key
	 */
	public StoreTxt (java.lang.Long id) {
		super(id);
	}

/*[CONSTRUCTOR MARKER END]*/
	
	/**
	 * 是否所有属性都为空
	 * 
	 * @return
	 */
	public boolean isAllBlank() {
		return StringUtils.isBlank(getTxt()) && StringUtils.isBlank(getTxt1())
				&& StringUtils.isBlank(getTxt2())
				&& StringUtils.isBlank(getTxt3());
	}
	
	public void init() {
		blankToNull();
	}

	public void blankToNull() {
		if (StringUtils.isBlank(getTxt())) {
			setTxt(null);
		}
		if (StringUtils.isBlank(getTxt1())) {
			setTxt1(null);
		}
		if (StringUtils.isBlank(getTxt2())) {
			setTxt2(null);
		}
		if (StringUtils.isBlank(getTxt3())) {
			setTxt3(null);
		}
	}


}